package com.chis.ms;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * 
 * @Description 
 * @Company zwx
 * @author wlj
 * @version 2019年04月25日
 */
public class Testlog {

    public static void main(String[] args) {
//        Map<String, List<String>> map1 = tt("C:\\Users\\wlj\\Desktop\\CK.txt");
//        Map<String, List<String>> map2 = tt("C:\\Users\\wlj\\Desktop\\RK.txt");
        List<String> list1 = tt1("C:\\Users\\wlj\\Desktop\\天津药监上传文件.txt");
        List<String> list2 = tt1("C:\\Users\\wlj\\Desktop\\123.txt");
        for(String key : list2){
                if(!list1.contains(key)){
                    System.out.println(key);
                }

        }




    }

    public static Map<String, List<String>> tt(String path) {
        File file1 = new File(path);
        FileReader m = null;
        try {
            m = new FileReader(file1);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        BufferedReader reader = new BufferedReader(m);
        Map<String, List<String>> map = new HashMap<>();
        while (true) {
            String nextline = null;
            try {
                nextline = reader.readLine();
                if (nextline != null && nextline.length() > 8) {
                    String[] ss = nextline.split("      ");
                    List<String> l = new ArrayList<>();
                    if(map.containsKey(ss[0])){
                        l = map.get(ss[0]);
                    }
                    l.add(ss[1]);
                    map.put(ss[0],l);

                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (nextline == null) break;
        }
        return map;
    }

    public static List<String> tt1(String path) {
        File file1 = new File(path);
        FileReader m = null;
        try {
            m = new FileReader(file1);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        BufferedReader reader = new BufferedReader(m);
        List<String> l = new ArrayList<>();
        while (true) {
            String nextline = null;
            try {
                nextline = reader.readLine();
                if (nextline != null && nextline.length() > 8) {
                    String[] ss = nextline.split("      ");

                    l.add(ss[1]);


                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (nextline == null) break;
        }
        return l;
    }


}
